package com.tedu._04mybatis.mapper;

import com.tedu._04mybatis.pojo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
//    @Insert("INSERT INTO weibo(content,created,user_id) VALUES (#{content},#{created},#{userId})")
    int insertWeibo(Weibo Weibo);

//    @Delete("DELETE FROM weibo WHERE id=#{id}")
    void deleteWeiboById(Integer id);

    @Update("UPDATE weibo SET content =#{content},created=#{created},user_id=#{userId} WHERE id =#{userId}")
    int UpdateWeiboById(Weibo weibo);

//    @Select("SElECT id,content,created,user_id userId FROM weibo WHERE id=#{id}")
    Weibo selectWeiboById(Integer id);

//    @Select("SElECT id,content,created,user_id userId FROM weibo")
    List<Weibo> selectAllWeibo();

//    @Select("SElECT content,created FROM weibo WHERE user_id=#{userId}")
    List<WeiboVo1 >selectWeiboVO1ById(Integer userId);

//    @Select("SElECT content,created,user_id userId FROM weibo ")
    List<WeiboVO2> selectWeiboVO2ById();

    int dynamicUpdateWeibo(Weibo weibo);

    int dynamicDeleteWeibo(Integer[] ids);

    int dynamicDeleteWeibo2(List<Integer>ids);

    int countWeibo();

    WeiboVO3 selectWeiboVO3ById(Integer id);
    List<WeiboVO3> selectAllWeiboVO3();

    UserVO1 selectUserWeiboById(Integer id );





}
